﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="icon.aspx.vb" Inherits="icon" %>
<%@ Import Namespace="System.Xml" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Icon Page</title>
</head>
<body>

<%
    
    Dim iconName As String = Request.QueryString("name")
    Dim iconAction As String = Request.QueryString("action")
    Dim iconOrder As String = Request.QueryString("order")
    
    If iconAction <> "" Then
        
        Dim xmlDoc As New XmlDocument()
        xmlDoc.Load(Server.MapPath("xml_icons.xml"))
        Dim node As XmlNode = xmlDoc.DocumentElement
        
    
        If iconAction = "add" Then
            If iconName <> "" Then
  


                Dim item As XmlElement = xmlDoc.CreateElement("item")
                'Dim name As XmlElement = xmlDoc.CreateElement("name")
    
                item.SetAttribute("name", iconName)
                item.SetAttribute("image", "images/icons/blanks.png")
                item.SetAttribute("file", "filesystem/blank.html")
                item.SetAttribute("level", "public")
         
                'item.AppendChild(name)
    
                node.InsertBefore(item, node.ChildNodes(iconOrder))
                
             
            End If
        End If
    
        
        If iconAction = "delete" Then
            If iconOrder <> "" Then
        
                Dim item As XmlElement = node.ChildNodes(iconOrder)
                node.RemoveChild(item)
                
                
            End If
        End If
       
        xmlDoc.Save(Server.MapPath("xml_icons.xml"))
        
    End If
        
%>

</body>
</html>
